#pragma once

#include <gofcl_timer_chctl.h>
#include <gofcl_timer_chctl01_r.h>

typedef struct {
	timer_chctl_mono_s CH02;
	timer_chctl_mono_s CH13;
} __attribute__((aligned(2))) timer_chctl_s;

_Static_assert(sizeof(timer_chctl_s) == 2,
	       "Struct timer_chctl_s defined error!");

static inline void timer_wreg_chctl_s(timer_qe timer_q,
				      timer_chctl_re channel_r,
				      timer_chctl_s chctl) {
	union {
		timer_chctl_s c;
		u16_s u;
	} cu = {
		.c = chctl,
	};
	timer_wreg_chctl(timer_q, channel_r, cu.u);
}
